package com.primary.mappers;

import com.primary.controller.request.HistoryRequest;
import com.primary.entity.History;
import com.primary.entity.dto.HistoryDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface HistoryMapper {
    /**
     * 用于分页显示信息
     * @param historyRequest
     */
    List<Map<String, Object>> listByPage(HistoryRequest historyRequest);

    /**
     * 插入一条数据
     * @param history
     * @return
     */
    int insertOne(History history);

    /**
     * 更新一条数据
     * @param history
     * @return
     */
    int updateOneById(History history);

    /**
     * 删除一条记录
     * @param id
     * @return
     */
    int deleteById(Integer id);

    /**
     * 导出献血记录
     */
    List<HistoryDto> exportInfo(@Param("actualname") String actualname);
}
